# 创建了3个列表
board = [['_'] * 3 for i in range(3)]
print(board)
board[1][2] = 'X'
print(board)
print()

# 创建了3个引用，指向同一个列表，没懂
weird_board = [['_'] * 3] * 3
print(weird_board)
weird_board[1][2] = '0'
print(weird_board)
print()

# 跟上例一样，append就是创建引用，同时指向row
row = ['_'] * 3
board = []
for i in range(3):
    board.append(row)

# 等同于例子1，创建了3个列表，并且有3个不同的引用指向他们
board = []
for i in range(3):
    row = ['_'] * 3
    board.append(row)
print(board)
board[2][0] = 'X'
print(board)
print()

if __name__ == '__main__':
    print('done')
